﻿<UserControl x:Class="Common.Controls.FilterText" 
  xmlns:itb="clr-namespace:PixelLab.Wpf;assembly=PixelLab.Wpf"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <UserControl.Resources>

    <!-- border style -->
    <Style x:Key="BorderStyle" TargetType="{x:Type Border}">
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="CornerRadius" Value="3" />
      <Setter Property="HorizontalAlignment" Value="Stretch" />
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
    </Style>

    <!-- textbox style -->
    <Style x:Key="TextStyle" TargetType="{x:Type TextBox}">
      <Setter Property="Margin" Value="2,1,2,2" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="BorderBrush" Value="{x:Null}" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="HorizontalAlignment" Value="Stretch" />
      <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <!-- reset button style -->
    <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
      <Setter Property="Width" Value="20" />
      <Setter Property="FontWeight" Value="Bold" />
      <Setter Property="BorderBrush" Value="{x:Null}" />
      <Setter Property="BorderThickness" Value="0" />
    </Style>
  </UserControl.Resources>

  <!-- filter control -->
  <Border Style="{StaticResource BorderStyle}">
    <DockPanel Height="23">
      <Button x:Name="FilterButton" DockPanel.Dock="Right" Content="X" Click="FilterButton_Click" Width="21" Height="21" ToolTip="清除过滤文本" />
      <itb:InfoTextBox TextBoxInfo="输入你要过滤的内容" x:Name="FilterTextBox" DockPanel.Dock="Left" Style="{StaticResource TextStyle}" TextChanged="FilterTextBox_TextChanged" />
    </DockPanel>
  </Border>

</UserControl>
